import request from '@/utils/request'

// 查询考勤列表
export function listAttendance(query) {
  return request({
    url: '/system/attendance/list',
    method: 'get',
    params: query
  })
}
// 查询排班表详细
export function getAttendance(query) {
  return request({
    url: '/system/attendance/class',
    method: 'get',
    params: query
  })
}

// // 查询考勤详细
// export function getAttendance(id) {
//   return request({
//     url: '/system/attendance/' + id,
//     method: 'get'
//   })
// }

// 新增考勤
export function addAttendance(data) {
  return request({
    url: '/system/attendance',
    method: 'post',
    data: data
  })
}

// 修改考勤
export function updateAttendance(data) {
  return request({
    url: '/system/attendance',
    method: 'put',
    data: data
  })
}

// 删除考勤
export function delAttendance(id) {
  return request({
    url: '/system/attendance/' + id,
    method: 'delete'
  })
}

// 导出考勤
export function exportAttendance(query) {
  return request({
    url: '/system/attendance/export',
    method: 'get',
    params: query
  })
}
export function month(month) {
  return request({
    url: '/system/attendance/month' + {month},
    method: 'get',
    params: query
  })
}

//新增一个排班表的详细信息
export function saveAttendances(data) {
  return request({
    url: '/system/attendance/saveAttendances',
    method: 'post',
    data: data
  })
}
